<?php 
include_once("../includes/config.php");
include_once("../includes/mod_function.inc.php");

global $TOP_CONTENT_CATEGORY_SID,$TOP_AREA_CATEGORY_SID ;

global $foxydb;

$usersid = ip_address_to_number($_SERVER['REMOTE_ADDR']);
$sid = $_REQUEST['sid'];
$favoriteranking = $_REQUEST['favoriteranking'];
$action = $_REQUEST['action'];
$foxydb->open();


$usersid = ip_address_to_number($_SERVER['REMOTE_ADDR']);
if($action == 'save'){
	if(!$ranking) $ranking="0";
	$foxydb->updateUserFavoriteSiteRanking($usersid,$sid,$favoriteranking);
}

$u2s = $foxydb->findUser2SiteBy($usersid,$sid);
//print_r($u2s);
$foxydb->close();

include_once("../includes/header.php");
?>
  <TABLE cellpadding=2 cellspacing=0 border=1>
  <TR><TD colspan='2' align=right><font size="-1">&nbsp;安装<A href='https://addons.mozilla.org/en-US/firefox/addon/5817' target='_blank'>一只青蛙Firefox插件</A>帮助你快速访问网站和搜索 action=<?php echo $action; ?>
  </font>
  </TD></TR>
  <TR>
	<TD valign="top">
	<?php if ($u2s) {?>
		<TABLE width="100%" cellpadding=0 cellspacing=0  border=1>
		<FORM action='editfavoritesitetag.php' method='POST' >
		<INPUT type='hidden' name='sid' value='<?php echo $u2s['sid']; ?>'>
		<INPUT type='hidden' name='action' value='save'>
		<TR>
			<TD align="center"><font size="-1">网址：</font></TD>
			<TD nowrap><?php echo $u2s['uri']; ?></TD>
		</TR>
		<TR>
			<TD align="center"><font size="-1">名称：</font></TD>
			<TD nowrap><?php echo $u2s['name']; ?></TD>
		</TR>
		<TR>
			<TD align="center"><font size="-1">显示积分：</font></TD>
			<TD nowrap><INPUT type='text' name='favoriteranking' size="8" value='<?php echo $u2s['favoriteranking']; ?>'></TD>
		</TR>
		<TR>
			<TD align="center"><font size="-1"></font></TD>
			<TD nowrap><INPUT type='submit' name='submit' value='保存'> &nbsp;&nbsp;<A href='editfavoritesites.php'>返回</A></TD>
		</TR>
		</FORM>
		</TABLE>
	<?php } else{?>
		没有找到网址。
	<?php }?>
	</TD>
  </TR>
  </TABLE>


<?php include("../includes/footer.php");?>